package com.ms.oschina.viewholder;

import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.FrameLayout;
import android.widget.ImageView;

import com.ms.oschina.R;
import com.ms.oschina.base.BaseViewHolder;
import com.ms.oschina.emoji.DisplayRules;
import com.ms.oschina.util.UiUtils;

public class ExpressionViewHolder extends BaseViewHolder<DisplayRules> {

	private ImageView iv;

	@Override
	public View initView() {
		FrameLayout fl = new FrameLayout(UiUtils.getContext());
		int size = UiUtils.getDimensionPixelSize(R.dimen.space_30);
		iv = new ImageView(UiUtils.getContext());
		fl.addView(iv, size, size);
		return fl;
	}

	@Override
	public void setData(int position, DisplayRules data) {
		iv.setImageResource(data.getResId());
	}
}
